package com.tomecode.mjprocessor.assembly.action;

/**
 * Process action type
 * 
 * @author Frastia Tomas
 * 
 */
public enum ActionType {

	/**
	 * remove value
	 */
	REMOVE("remove"),

	/**
	 * replace value
	 */
	REPLACE("replace"),
	/**
	 * insert new value
	 */
	INSERT("insert");
	private final String value;

	private ActionType(String value) {
		this.value = value;
	}

	public final static ActionType parse(String value) {
		ActionType[] actions = values();
		for (ActionType action : actions) {
			if (action.value.toLowerCase().equals(value)) {
				return action;
			}
		}
		throw new IllegalArgumentException("not found action type for value[" + value + "]");
	}
}
